<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,user-scalable=no"/>
    <meta name="_ctx" th:content="@{/}" />
    <title>Siterwell智能家居</title>
    <link th:href="@{/css/css.css}" href="../../static/css/css.css" rel="stylesheet" type="text/css">
    <link  th:href="@{/js/jquery-ui.css}" rel="stylesheet" href="../../static/js/jquery-ui.css">
    <script th:src="@{/js/jquery.js}" src="../../static/js/jquery.js"></script>
    <script th:src="@{/js/jquery-ui.js}" src="../../static/js/jquery-ui.js"></script>
    <script th:src="@{/js/common.js}" src="../../static/js/common.js"></script>
    <script type="text/javascript">
        $(function () {

            $("#submit").click(function(){
                creatMask();
                var _ctx = $("meta[name='_ctx']").attr("content");
                _ctx = _ctx.substr(0, _ctx.length - 1);

                var username = $("#usernm").val().trim();
                var psw = $("#pass").val().trim();
                $.ajax({
                    type:"POST",
                    url:_ctx+"/genie/login",
                    cache:false,
                    dataType:"json",
                    data:{username:username,password:psw},
                    success:function(data){
                        removeMask();
                        if(data.code===200){
                            window.location.href=data.data;
                        }else{
                            $( "#content" ).html(data.msg);
                            $( "#dialog" ).dialog({
                                title:"提示"
                            });
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        removeMask();
                    }
                });



            });
        });
    </script>
</head>
<body >
<div class="body">
    <div style="position: fixed;
    width:100%;
    height: 100%;
    background-color: #a6afb5;
    background-size: cover;"></div>
    <div style="position:absolute; width:100%; top:0; left:0; ">
        <div class="touxiang"><img src="../../static/images/logo.png" th:src="@{/images/logo.png}" alt=""/></div>
        <div class="wenzi">Siterwell智能家居</div>
        <div class="kuan4">
            <div class="inp1" style="border-bottom:1px solid #c6c6c6	"><div style="width:8%; float:left"><img src="../../static/images/username.png" th:src="@{/images/username.png}"  alt=""/></div>
                <input type="text" placeholder="请输入用户名" name="username" class="codein" id="usernm"/>
            </div>
            <div class="inp2"><div style="width:8%; float:left"><img src="../../static/images/password.png" th:src="@{/images/password.png}"  alt=""/></div>
                <input type="password" placeholder="请输入密码" name="password" class="codein" id="pass"/>
            </div>
        </div>
        <div style="width:68%; margin:0 auto; margin-top:5%">
            <div class="newss1"><a id="submit">登 录</a></div>


        </div>
        <div class="wenzi2">版权所有-赛特威尔电子股份有限公司</div>
    </div>


</div>
</div>
</div>
<div id="dialog" title="基本的对话框">
    <p id="content"></p>
</div>
</body>
</html>